/*pmFWCFu5nhKkBzYmrkBakYsZp5swriLu08OGCHqhiBP8j8oYSTPG1fSFojrU7cKi*/
import { toast } from 'nc-lightapp-front';
import { modifierSearchMetas } from '../../../../public/components/pubUtils/arapListSearchRefFilter';
import { pagecode, appcode, searchId, billType } from '../constants';
import setDefOrgBilldateSrchArea from '../../../../public/components/defOrgBilldateSrchArea.js';

export default function (props) {
	let that = this;
	if(!props.getUrlParam('src_appcode')){
		props.setUrlParam({ src_appcode: appcode});
		toast({ color: 'warning', content: this.state.json['public-000250'] });
	}
	props.createUIDom(
		{
			pagecode: pagecode,
			appcode: props.getUrlParam('src_appcode') ? props.getUrlParam('src_appcode') : appcode,
		},
		function (data) {
			if (data) {
				if (data.template) {
					if (!data.template[searchId]) {
						return;
					}
					//高级查询设置财务组织默认值
					// data.context.paramMap.pk_transtype=null;
					// data.context.paramMap.transtype_name=null;
					setDefOrgBilldateSrchArea(props, searchId, data);
					let meta = data.template;
					modifierSearchMetas(searchId, props, meta, billType, null, that);
					props.meta.setMeta(meta);
				}
				if (data.button) {
					let button = data.button;
					props.button.setButtons(button);
				}
			}
		}
	)
}

/*pmFWCFu5nhKkBzYmrkBakYsZp5swriLu08OGCHqhiBP8j8oYSTPG1fSFojrU7cKi*/